﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FormControllers;
using Ecopsy.DataTier;
using AgencyEntityLib.BaseEntity;

public partial class iFrameAdmin_TreeDictionaryMap : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) MyDataBind();
        
    }

    protected void MyDataBind()
    {
        // вернуть перечень древовидных справочников в ситеме
        Agency a = GlobalConstants.CurrentAgency;
        lvTreeDictionaryMap.DataSource = a.GetTreeDictionarySettingsMap(); ;
        lvTreeDictionaryMap.DataBind();

    }
    protected void ReverceSetting_Click(object sender, EventArgs e)
    {
        Button btn = (Button)sender;
        Agency a = GlobalConstants.CurrentAgency;
        a.ReverceSetting_UseSystemDictionary(btn.CommandArgument);
        wsAgency ws = new wsAgency();
        ws.SaveAgency();
        MyDataBind();
    }
}

